def power(x,n=2):
    s = 1;
    while n>0:
        n = n-1;
        s = s*x;
    return s;


print(power(88,3));
print(power(88));


def add_end(l=None):
    if l is None:
        l = [];
    l.append('end');
    return l;



print(add_end(['sss']));

print(add_end());

print(add_end())


def calc(*numbers):
    sum = 0;
    for n in numbers:
        sum = sum + n* n;
    return sum;

#a = calc([1,2,3]);
#b = calc((1,2,34));
#print(a);
#print(b);


def person(name , age , **desc):
    print('name:' , name ,'age: ' ,age ,'desc: ' ,desc);


person('x',111);

person('x',111,city='BeiJing');

person('x',111,gender='M',city='ShangHai');


extra = {'city': 'BJ','job': 'Engineer'};

person('Jack',22,city=extra['city'],job=extra['job']);


person('Tom',66,**extra);



def person1(name,age,*,city,job,desc):
    print(name,age,city,job,desc);


person1('jack',12,city='BJ',job='eng',desc=1);


def person2(name,age,*args,city,job):
    print(name,age,args,city,job);



person2('Jony',11,'a' ,'b',city='bj',job='eny');

def person4(name,age,*,city='bj',job):
    print(name,age,city,job);


person4('jack',11,job='asad');


